/**
 * Created by shenchangmin on 2016/12/12.
 */
const User = require('../lib/mongo').User;

module.exports = {
    // 注册一个用户
    create(user) {
        return User.create(user).exec();
    },

    //通过用户名获取用户信息
    getUserByName(name) {
        return User.findOne({
            name
        }).addCreatedAt().exec();
    }
};
